<template>
      <section>
        <h1>密码登录</h1>
        <input type="text" placeholder="手机/用户名" v-model="usename"><br>
        <input type="text" placeholder="密码" v-model="password"><br>
        <button @click="deng" type="submit">登录</button><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>手机号登录</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <span>忘记密码</span>
        <div>已阅读并同意<span>《用户服务协议》、《隐私政策》</span></div>
    </section>
</template>

<script>
import { dengLu } from '../api/index.js';

export default {
    data(){
        return{
                usename:'',
                password:''
            }
    },
    methods:{
        deng(){
            console.log(this.usename);
            console.log(this.password);

            dengLu({phone:this.usename,pass:this.password}).then((res)=>{
                // console.log(res.data.msg);
                if(res.data.code==400){
                    alert(res.data.msg)
                }else if(res.data.code==200){
                    alert(res.data.msg)
                    this.$router.push('/chushi/liebiao')                }
            })
        }
    }
}
</script>

<style scoped>
    section button{
        margin-top: 30px;
        margin-left: 40px;
        margin-bottom: 20px;
        width: 300px;
        border-radius: 10px;
        height: 40px;
    }
    section h1{
        width: 100%;
        height: 200px;
        text-align: center;
        line-height: 200px;
    }
    section input{
        margin-top: 10px;
        margin-left: 40px;
        width: 300px;
        height: 35px;
    }
    section span{
        font-size: 14px;
        color: aqua;
    }
    section div{
        font-size: 12px;
        margin-top: 200px;
    }    
</style>